<div class="layuimini-container">
    <form id="app-form" class="layui-form layuimini-form">
        
<!--        <div class="layui-form-item">-->
<!--            <label class="layui-form-label">分类ID</label>-->
<!--            <div class="layui-input-block">-->
<!--                <select name="cate_id" lay-verify="required" data-select="{:url('mall.cate/getCateByList')}"-->
<!--                        data-fields="id,title" data-value="{$row.cate_id|raw}">-->
<!--                </select>-->
<!--            </div>-->
<!--        </div>-->
        <div class="layui-form-item">
            <label class="layui-form-label">所属分类</label>
            <div class="layui-input-block" id="cate_div">
                <tip>福利包分类务必只能选择一个福利包下的分类</tip>
            </div>
            <input type="hidden" name="cate_ids" id="cate_ids" value="{$row.cate_ids}">
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">商品名称</label>
            <div class="layui-input-block">
                <input type="text" name="title" class="layui-input" lay-verify="required" placeholder="请输入商品名称" value="{$row.title|default=''}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">商品副标题</label>
            <div class="layui-input-block">
                <input type="text" name="thumb_title" class="layui-input" lay-verify="required" placeholder="请输入商品副标题"
                       value="{$row.thumb_title|raw}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">商品视频</label>
            <div class="layui-input-block layuimini-upload">
                <input name="video" class="layui-input layui-col-xs6" placeholder="请上传视频"
                       value="{$row.video|default=''}">
                <div class="layuimini-upload-btn">
                    <span><a class="layui-btn" data-upload="video" data-upload-number="one" data-upload-exts="mp4"
                             data-upload-icon="file"><i class="fa fa-upload"></i> 上传</a></span>
                    <span><a class="layui-btn layui-btn-normal" id="select_video" data-upload-select="video"
                             data-upload-number="one" data-upload-mimetype="*"><i class="fa fa-list"></i> 选择</a></span>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">商品logo</label>
            <div class="layui-input-block layuimini-upload">
                <input name="logo" class="layui-input layui-col-xs6"   placeholder="请上传商品logo" value="{$row.logo|default=''}">
                <div class="layuimini-upload-btn">
                    <span><a class="layui-btn" data-upload="logo" data-upload-number="one" data-upload-exts="png|jpg|ico|jpeg" data-upload-icon="image"><i class="fa fa-upload"></i> 上传</a></span>
                    <span><a class="layui-btn layui-btn-normal" id="select_logo" data-upload-select="logo" data-upload-number="one" data-upload-mimetype="image/*"><i class="fa fa-list"></i> 选择</a></span>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">商品图片 以 | 做分割符号</label>
            <div class="layui-input-block layuimini-upload">
                <input name="images" class="layui-input layui-col-xs6"   placeholder="请上传商品图片 以 | 做分割符号" value="{$row.images|default=''}">
                <div class="layuimini-upload-btn">
                    <span><a class="layui-btn" data-upload="images" data-upload-number="one" data-upload-exts="png|jpg|ico|jpeg" data-upload-icon="image"><i class="fa fa-upload"></i> 上传</a></span>
                    <span><a class="layui-btn layui-btn-normal" id="select_images" data-upload-select="images" data-upload-number="one" data-upload-mimetype="image/*"><i class="fa fa-list"></i> 选择</a></span>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">是否指定商品</label>
            <div class="layui-input-block">
                <input type="radio" name="is_appoint" value="0" title="否" checked>
                <input type="radio" name="is_appoint" value="1" title="是">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">选择规格</label>
            <div class="layui-input-block">
                <input type="radio" name="specifications" lay-filter="cate" value="0" title="单规格" {if condition="$row.specifications == 0"}checked{/if}>
                <input type="radio" name="specifications" lay-filter="cate" value="1" title="多规格" {if condition="$row.specifications == 1"}checked{/if}>
            </div>
        </div>
        <div class="specs_one" {if condition="$row.specifications == 1"}style="display:none"{/if}>
            <div class="layui-form-item">
                <label class="layui-form-label">市场价格</label>
                <div class="layui-input-block">
                    <input type="text" name="market_price" class="layui-input" lay-verify="required"
                           placeholder="请输入市场价格"
                           value="{$row.market_price|raw}">
                </div>
            </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">成本价</label>
            <div class="layui-input-block">
                <input type="text" name="cost_price" class="layui-input" lay-verify="required"
                       placeholder="请输入折扣价格"
                       value="{$row.cost_price|raw}">
            </div>
        </div>
            <div class="layui-form-item">
                <label class="layui-form-label required">卖价</label>
                <div class="layui-input-block">
                    <input type="text" name="price" class="layui-input" lay-verify="required"
                           placeholder="请输入折扣价格"
                           value="{$row.price|raw}">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label required">库存</label>
                <div class="layui-input-block">
                    <input type="text" name="stock" class="layui-input" lay-verify="required" placeholder="请输入库存" value="{$row.stock|raw}">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label required">总库存</label>
                <div class="layui-input-block">
                    <input type="text" name="total_stock" class="layui-input" lay-verify="required" placeholder="请输入总库存" value="{$row.total_stock}">
                </div>
            </div>
        </div>
        <div class="specs_two" {if condition="$row.specifications == 0"}style="display:none"{/if}>

            <div class="layui-form-item">
                <label class="layui-form-label">规格：</label>
                <div class="layui-input-block">
                    <a class="layui-btn layui-btn-primary" data-open="mall.goods/dialog" data-title="添加规格"
                       data-full="false">添加规格</a>
                    <table class="layui-table" id="spec-table">
                        <thead>
                        <tr>
                            <th>规格名</th>
                            <th>规格值</th>
                        </tr>
                        </thead>
                        <input type="hidden" name="id" value="{$id}" id="goods_id">
                        <tbody class="skus-warp">
                            {volist name="tree" id="vo"}
                            <tr>
                                <td data-id="{$vo.id}">{$vo.specs_title}</td>
                                <td>
                                    {volist name="vo.child" id="v"}
                                    <input type="checkbox" title="{$v.title}" lay-filter="filter" value="{$v.id}" {if condition="$v.checked eq 'checked'"}checked{/if}>
                                    {/volist}
                                </td>
                            </tr>
                            {/volist}

                        <!--                        <tr>-->
                        <!--                            <td data-id="2">款式</td>-->
                        <!--                            <td>-->
                        <!--                                <input type="checkbox" title="男款" lay-filter="filter" value="8" checked>-->
                        <!--                                <input type="checkbox" title="女款" lay-filter="filter" value="9" checked>-->
                        <!--                            </td>-->
                        <!--                        </tr>-->
                        </tbody>
                    </table>
                </div>
            </div>
            <div class="layui-form-item layui-hide">
                <label class="layui-form-label">SKU表：</label>
                <div class="layui-input-block">
                    <table class="layui-table" id="sku-table">
                        <thead></thead>
                        <tbody></tbody>
                    </table>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">虚拟销量</label>
            <div class="layui-input-block">
                <input type="text" name="sales" class="layui-input" placeholder="请输入虚拟销量" value="{$row.sales}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">商品描述</label>
            <div class="layui-input-block">
                <script type="text/plain" id="container" name="describe">{$row.describe|raw|default=''}</script>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">排序</label>
            <div class="layui-input-block">
                <input type="text" name="sort" class="layui-input"  placeholder="请输入排序" value="{$row.sort|default=''}">
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">备注说明</label>
            <div class="layui-input-block">
                <textarea name="remark" class="layui-textarea"  placeholder="请输入备注说明">{$row.remark|raw|default=''}</textarea>
            </div>
        </div>
        <div class="hr-line"></div>
        <div class="layui-form-item text-center">
            <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit>确认</button>
            <button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">重置</button>
        </div>
    </form>
</div>
<script src="__STATIC__/plugs/jquery-3.4.1/jquery-3.4.1.min.js"></script>
<script type="text/javascript">
    $(document).ready(function (){
        var ue = UE.getEditor('container');
    })
</script>
